package com.usian.day02.fegin;

import com.usian.common.model.day01.User;
import com.usian.common.vo.ResultResopnse;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @author baimugudu
 * @email 2415621370@qq.com
 * @date 2023/7/26 13:54
 */
@FeignClient("day01-1")
public interface UserFeginService {

    @GetMapping(value = "/user/list")
    public ResultResopnse list();

    @GetMapping(value = "/user/{id}")
    public ResultResopnse findById(@PathVariable("id") String id);

    @PostMapping(value = "/user/findByUser")
    public List<User> findByUser1(@RequestBody User user);

    @GetMapping(value = "/user/findByUser")
    public List<User> findByUser(@RequestParam("username") String username,
                                 @RequestParam("password") String password);

    @PostMapping("/user/save")
    public ResultResopnse savUser(@RequestBody User user);

    @PutMapping("/user/update")
    public ResultResopnse update(@RequestBody User user);

    @DeleteMapping("/user/{id}")
    public ResultResopnse deleteById(@PathVariable("id") String id);

}
